import {defHttp} from '/@/utils/http/axios';
import {getPermissionResultModel} from './model/menuModel';

enum Api {
  // 获取系统权限
  // 1、查询用户拥有的按钮/表单访问权限
  // 2、所有权限
  // 3、系统安全模式
  GetPermission = '/system-service/menu/getUserPermission',
  SwitchVue3Menu = '/system-service/switchVue3Menu',
}

/**
 * @description: Get user menu based on id
 */

export const getPermission = () => {
  return defHttp.get<getPermissionResultModel>({ url: `${Api.GetPermission}`})
};

/**
 * 切换成vue3菜单
 */
export const switchVue3Menu = () => {
  return new Promise((resolve) => {
    defHttp.get({ url: Api.SwitchVue3Menu });
  });
};
